#ifndef __GAMESTATE_H__
#define __GAMESTATE_H__

// AGT Systems include
#include <AGTRenderSystem/RenderManager.h>
#include <AGTInputSystem/InputManager.h>
#include <AGTObjectSystem/ObjectSceneManager.h>

//#include "GameStateMgr.h"


/*
	Class control a state. Inherits control class from InputHandler and updates through inheriting from
	Ogre::FrameListener
*/
class GameState : public InputHandler, public Ogre::FrameListener
{
protected:
	std::string m_sStateName;
	GameState(){};	// Cannot instantiated from this class
public:
	virtual ~GameState(){};

	virtual void enter()=0;			// Function called when after changing over to a new state
	virtual void exit()=0;			// Function called upon calling to changed to a new state

	virtual void pause()=0;
	virtual void resume()=0;


	virtual void update()=0;		// Updates the states.

	virtual bool frameStarted(const Ogre::FrameEvent& evt)=0;
	virtual bool frameEnded(const Ogre::FrameEvent& evt)=0;


	// Handling presses and releases
	virtual bool updateKey()=0;
	virtual bool updateMouse()=0;
	virtual bool updateJoy()=0;


	// Mouse Listener functions
	virtual bool mouseMoved(const OIS::MouseEvent &evt)=0;
	virtual bool mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID)=0;
	virtual bool mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID)=0;



	// Keyboard listener functions
	virtual bool keyPressed(const OIS::KeyEvent &evt)=0;
	virtual bool keyReleased(const OIS::KeyEvent &evt)=0;

	// Joystick listener functions
	virtual bool buttonPressed(const OIS::JoyStickEvent &evt, int index)=0;
	virtual bool buttonReleased(const OIS::JoyStickEvent &evt, int index)=0;
	virtual bool axisMoved(const OIS::JoyStickEvent &evt, int index)=0;
	virtual bool povMoved(const OIS::JoyStickEvent &evt, int index)=0;


	void changeState(GameState* state)
	{
	}

};

#endif